<html>
        <head>
                <meta charset="utf-8" />
                <title>产品预订</title>                
                <meta name="viewport" id="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
                <link rel="stylesheet" type="text/css" href="__MOBILE__/css/mobile-style.css" />
		<link rel="stylesheet" type="text/css" href="__MOBILE__/css/mobile-line.css" />
                <script src="http://libs.baidu.com/jquery/1.7.2/jquery.min.js"></script>
                <script type="text/javascript" language="JavaScript">
			var bookurl = '{:U("Line/mobiledan" ,"","")}';
		</script>
        </head>
        <body>
                <header class="header">
                        <a href="javascript:window.history.go(-1);" class="ic_back"></a>
                        <h2>产品预订</h2>
                        <a href="javascript:;" class="navbtn"><span></span><span></span><span></span></a>
                </header>
                <!--详细内容-->
                <div class="threeBox">
                        <div class="threeBox_book">
                                <h1>{$line.title}</h1>
                                <form id="step1" action="" method="post" data-ajax="false" autocomplete="off" name="n1">
								
                                        <input type="hidden" id="line_id" name="line_id" value="{$line.id}" />
					<input type="hidden" id="supplier_id" name="supplier_id" value="{$line.supplier_id}" />
					<div class="threeBox_book_box">
                                                <p class="theleft">联&nbsp;&nbsp;系&nbsp;人</p>
                                                <p class="theright">
                                                        <input type="text" id="line_name" name="line_name" class="inputbox" value="" />
                                                </p>
                                        </div>

                                        <div class="threeBox_book_box">
                                                <p class="theleft">预订人数</p>
                                                <p class="theright">
                                                        <input type="text" id="line_ren" name="line_ren" class="inputbox" value=""> 
                                                </p>
                                        </div>

                                        <div class="threeBox_book_box">
                                                <p class="theleft">联系方式</p>
                                                <p class="theright">
                                                        <input type="text" id="line_phone" name="line_phone" class="inputbox" value=""> 
                                                </p>
                                        </div>

                                        <div class="threeBox_btn">
                                                <a href="javascript:window.history.go(-1);" class="threeBox_btn_back">返回上一步</a>
                                                <a href="javascript:;"  id="send-btn" class="threeBox_btn_tijiao">提交订单</a>
                                        </div>
                                </form>
								
                        </div>
                </div>


                <!--页脚-->
        <include file="Public:footer" />
        <script>
		$(function () {
			$('#send-btn').click(function () {
				var line_id = $('input[name=line_id]');
				var supplier_id = $('input[name=supplier_id]');
				var line_ren = $('input[name=line_ren]');
				var line_name = $('input[name=line_name]');
				var line_phone = $('input[name=line_phone]');
				if (line_name.val() == '') {
					alert('请输入联系人信息！');
					line_name.focus();
					return;
				}
				if (line_ren.val() == '') {
					alert('请填写出游人数！');
					line_ren.focus();
					return;
				}
				if (!(/^1[3|5|4|8][0-9]\d{4,8}$/.test(line_phone.val()))) {
					alert("不是完整的11位手机号或者不正确的手机号");
					return false;
				}
				$.post(bookurl, {
					line_id: line_id.val(),
					supplier_id: supplier_id.val(),
					line_ren: line_ren.val(),
					line_name: line_name.val(),
					line_phone: line_phone.val()
				}, function (data) {
					if (data.status) {
						alert('您的询单已成功提交！');
						window.location.href = "{$domain_url}";
					} else {
						alert('操作失败');
					}
				}, 'json');
			});
		});
        </script>

</body>
</html>
